<h2>短消息&gt; 列表</h2>
<script type="text/javascript" src="/js/sms.js"></script>
<script type="text/javascript" src="/js/calendar/WdatePicker.js"></script>
<form action="<?= AdminController::_makeURL('sms','sms','list') ?>" method="post">
<table class="list" cellpadding="0" cellspacing="0" with="100%">
<tr>
	<td>用户uid</td>
    <td><input type="text" name="uid" value="<?=_('uid')?>" /></td>
</tr>
<tr>
	<td>按时间搜索</td>
	<td><span>开始时间：</span>
<input id="start" name="start" class="Wdate" type="text" onFocus="var end=$dp.$('end');WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked:function(){end.focus();},maxDate:'#F{$dp.$D(\'end\')}'})" value="<?=_('start')?>" style="width:150px"/>
<span>结束时间：</span>
<input type="text" id="end" name="end" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'start\')}'});" class="Wdate" style="width:150px" value="<?=_('end')?>"/></td>
</tr>
<tr nowrap="nowrap">
	<td colspan="2" align="center"><input type="submit" value="开始搜索"  /></td>
</tr>
</table>
</form>
<table class="list" cellpadding="0" cellspacing="0" with="100%">
	<thead align="right">
    <td colspan="9"><a href="<?= AdminController::_makeURL('sms','sms','list') ?>">全部</a>  | <a href="<?= AdminController::_makeURL('sms','sms','list',array('type'=>2)) ?>"> 未审核</a> |  <a href="<?= AdminController::_makeURL('sms','sms','list',array('type'=>1)) ?>">已审核 </a> | <a href="<?= AdminController::_makeURL('sms','sms','list',array('delete'=>1)) ?>"> 已删除</a></td>
    </thead>
	<thead align="center">
		<td nowrap>序号</td>
		<td nowrap>id</td>
		<td nowrap>内容</td>
		<td nowrap>创建者</td>
		<td nowrap>UID</td>
		<td nowrap>创建时间</td>
		<td nowrap>消息状态</td>
		<td nowrap>审核状态</td>
		<td nowrap>操作</td>
	</thead>
	<?php $i=1;?>
	<? foreach($this->ret['data']['ret']['ROWS'] as $row):?>
	<tr  ondblclick='$$(".sms_content").each(function(v){v.toggle();})' style="background:#fcf3d6" >
		<td><?php echo $i;?></td>
		<td>
			<?= $row['sms_id'] ?>
		</td>
		<td nowrap onclick='$("sms_content_<?=$row['sms_id']?>").toggle()' >
				<?= mb_substr(strip_tags(sms_util_text::formatOutputContent($row['sms_content'])), 0,20,'utf8') ?>;
		</td>
		<td>
			<a href="http://i.178.com/?uid=<?=$row['sms_senderid']?>" target="_blank" ><?= $row['sms_sender']?></a>
		</td>
		<td>
			<?= $row['sms_senderid']?>
		</td>
		
		<td nowrap>
			<?= date('Y-m-d H:i:s', $row['sms_dateline']) ?>
		</td>
		<td>
			<?PHP
			switch($row['sms_isdelete']){
				case 1:
					echo '本人删除';break;
				case 4:
					echo '管理员删除';break;
				default:
					echo '正常';break;
			} 
			?>
		</td>
		<td>
			<?PHP
			$str = '已审核';
			if($row['sms_verify']==2)
				$str = '未审核';
			if($row['sms_isdelete']){
				$str = '已删除';
			}
			echo $str;
			?>
		</td>
		<td nowrap>
			<?php if($row['sms_isdelete']==4):?>
			<!-- <a href='###' sid="<?= $row['sms_id']?>" class="delete-link">恢复</a> -->
			<a href="<?= AdminController::_makeURL('sms','sms','resume',array('id'=>$row['sms_id'])) ?>" class="resume-link">恢复</a>
			<?php else:?>
			<?php if($row['sms_verify']!=1 && $row['sms_isdelete']<1):?>
			<label for="<?=$row['sms_id']?>_1"> <input type="radio" id="<?=$row['sms_id']?>_1" value="<?=$row['sms_id']?>" name="<?=$row['sms_id']?>" checked="checked" />通过</lable>
			<?php endif;?>
			<label for="<?=$row['sms_id']?>_0"> <input type="radio" id="<?=$row['sms_id']?>_0" value="<?=$row['sms_id']?>" name="<?=$row['sms_id']?>" />删除</lable>
			<?php endif;?>
			<!-- <a href='<?= AdminController::_makeURL('sms', 'sms', 'edit_form', array('id'=>$row['sms_id']))?>'>修改</a>
			 |  
			<a href="<?= AdminController::_makeURL('sms', 'sms', 'verify', array('id'=>$row['sms_id']))?>" >审核</a>			 | -->
			
		</td>
	</tr>
	<tr style="display:none" id="sms_content_<?=$row['sms_id']?>" class="sms_content" >
		<td colspan="9" bgcolor="#FFFFEE">
			<script>
				UBBCode.output("<?= sms_util_text::formatOutputContent($row['sms_content'])?>");
			</script>
		</td>
	</tr>
	<?php ++$i;?>
	<? endforeach;?>
</table>
<table class="list" cellpadding="0" cellspacing="0">
	<thead>
		<td nowrap>
		 <!-- <input type="checkbox" id="checkall" onclick="checkall()" />  -->&nbsp;&nbsp;<input type="button" id="verify" name="verify" onclick="verify_sel()" value="审核"  /> &nbsp;&nbsp;<!-- <input type="button" id="del_sel" name="del_sel" onclick="verify_sel(1)" value="屏蔽短信" />&nbsp;&nbsp;<input type="button" id="del_sel" name="del_sel" onclick="verify_sel(2)" value="删除所选" /> -->
        </td>
    	<td align="right" nowrap>
			<?=$this->ret['data']['pages']?>
        </td>
    </thead>
</table>
<script>
$$('.resume-link').each(function(item){
	item.observe('click', resume_sel);
});
hookDeleteConfirm.hook = function(src){ return $H({_app: 'sms', _controller: 'sms', _action: 'resume', id: src.getAttribute('sid')}).toQueryString();};
</script>